home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
science
/
bodeplot.zip
/
BODEPLOT.SRC
< prev
next >
Wrap
Text File
|
1993-08-20
|
931b
|
27 lines
%%HP: T(3)A(D)F(.);
@ BODEPLOT
@ by James B. Walters
DIR
BODE @ Main program.
\<< ERASE DB STEQ @ This routine plots the gain and phase
0 4 XRNG -60 20 @ of the transfer function G.
YRNG DRAX DRAW @ Plots 4 decades from Wo, gain from -60 dB
PHASE STEQ -270 90 @ to 20 dB, and phase from -270 to 90 degrees.
YRNG DRAW @ Plot range can be modifed by changing program.
\>>
PHASE 'ARG(G)' @ Phase of G defined as ARG(G)
Wo .1 @ Wo is start frequency of bode plot
X 4.1
EQ 'ARG(G)'
PPAR { (0,-270)
(4,90) X 0 (0,0)
FUNCTION Y }
D 'S^2+1*S+100' @ D is denominator of transfer function
N 100 @ N is numerator of transfer function
G 'N/D' @ G is the transfer function
DB '20*LOG(ABS(G) @ DB is the gain of G
)'
S 'i*W' @ S is defined as W*sqr(-1)
W 'Wo*10^X' @ Map plot axis to frequency for log scale
END